package 行为型模式.观察者模式;

public class Client {
    public static void main(String[] args) {
        //1.创建公众号对象
        SubscriptionSubject subject=new SubscriptionSubject();

        //2.订阅公众号
        subject.attach(new WeChatUser("孙悟空"));
        subject.attach(new WeChatUser("猪八戒"));
        subject.attach(new WeChatUser("沙和尚"));

        //3.公众号更新，发出消息给观察者对象
        subject.notify("嘉心糖背大锅更新了");
    }
}
